home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / AOCE / Development Tools / Interfaces / CIncludes / OCEMail.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-11-10  |  41.0 KB  |  1,373 lines  |  [TEXT/MPS ]

  1. /************************************************************
  2.  
  3. Created: Tuesday, August 17, 1993 4:37:24 PM
  4.  OCEMail.h
  5.  C Interface to the Macintosh Libraries
  6.  
  7.   Copyright Apple Computer, Inc. 1990-1993
  8.   All rights reserved
  9.  
  10. ************************************************************/
  11.  
  12.  
  13. #ifndef __OCEMAIL__
  14. #define __OCEMAIL__
  15.  
  16. #ifndef __DIGITALSIGNATURE__
  17. #include <DigitalSignature.h>
  18. #endif
  19.  
  20. #ifndef __FILES__
  21. #include <Files.h>
  22. #endif
  23.  
  24. #ifndef __MEMORY__
  25. #include <Memory.h>
  26. #endif
  27.  
  28. #ifndef __OCE__
  29. #include <OCE.h>
  30. #endif
  31.  
  32. #ifndef __OCEAUTHDIR__
  33. #include <OCEAuthDir.h>
  34. #endif
  35.  
  36. #ifndef __OCEMESSAGING__
  37. #include <OCEMessaging.h>
  38. #endif
  39.  
  40. #ifndef __TEXTEDIT__
  41. #include <TextEdit.h>
  42. #endif
  43.  
  44. #ifndef __TYPES__
  45. #include <Types.h>
  46. #endif
  47.  
  48. /**************************************************************************************/
  49. /* Common Definitions */
  50. /**************************************************************************************/
  51. #define MailParamBlockHeader    \
  52.     Ptr            qLink;            \
  53.     long        reservedH1;        \
  54.     long        reservedH2;        \
  55.     ProcPtr        ioCompletion;    \
  56.     OSErr        ioResult;        \
  57.     long        saveA5;            \
  58.     short        reqCode;
  59.  
  60. typedef long MailMsgRef;                /* reference to a new or open letter or message */
  61.  
  62. typedef long MSAMQueueRef;            /* reference to an open msam queue */
  63. typedef unsigned short MSAMSlotID;    /* identifies slots managed by a PMSAM */
  64.  
  65. typedef long MailboxRef;                /* reference to an active mailbox */
  66. typedef unsigned short MailSlotID;        /* identifies slots within a mailbox */
  67.  
  68. struct MailSeqNum {                        /* identifies a letter in a mailbox */
  69.     MailSlotID            slotID;
  70.     long                seqNum;
  71. };
  72.  
  73. typedef struct MailSeqNum MailSeqNum;
  74.  
  75. /* A MailBuffer is used to describe a buffer used for an IO operation.
  76. The location of the buffer is pointed to by 'buffer'. 
  77. When reading, the size of the buffer is 'bufferSize' 
  78. and the size of data actually read is 'dataSize'.
  79. When writing, the size of data to be written is 'bufferSize' 
  80. and the size of data actually written is 'dataSize'.
  81. */
  82.  
  83. struct MailBuffer {
  84.   long    bufferSize;                        
  85.   Ptr    buffer;                            
  86.   long    dataSize;                        
  87. };
  88.  
  89. typedef struct MailBuffer MailBuffer;
  90.  
  91. /* A MailReply is used to describe a commonly used reply buffer format.
  92. It contains a count of tuples followed by an array of tuples.
  93. The format of the tuple itself depends on each particular call.
  94. */
  95. struct MailReply {                
  96.     unsigned short    tupleCount;    
  97.     /* tuple[tupleCount] */        
  98. };                    
  99.  
  100. typedef struct MailReply MailReply;
  101.  
  102. /* Shared Memory Communication Area used when Mail Manager sends 
  103. High Level Events to a PMSAM. 
  104. */
  105. struct SMCA {
  106.     unsigned short        smcaLength;        /* includes size of smcaLength field */
  107.     OSErr                result;            
  108.     long                userBytes;        
  109.     union {
  110.         CreationID        slotCID;        /* for create/modify/delete slot calls */
  111.         long            msgHint;        /* for kMailEPPCMsgOpened */
  112.     } u;
  113. };
  114.  
  115. typedef struct SMCA SMCA;
  116.  
  117. /**************************************************************************************/
  118. /* Value of creator and types fields for messages and blocks defined by MailManager */
  119. #define kMailAppleMailCreator        'apml'        /* message and letter block creator */
  120.  
  121. #define kMailLtrMsgType                'lttr'        /* message type of letters, reports */
  122. #define kMailLtrHdrType                'lthd'        /* contains letter header */
  123. #define kMailContentType            'body'        /* contains content of letter */
  124. #define kMailEnclosureListType        'elst'        /* contains list of enclosures */
  125. #define kMailEnclosureDesktopType    'edsk'        /* contains desktop mgr info for enclosures */
  126.  
  127. #define kMailEnclosureFileType        'asgl'        /* contains a file enclosure */
  128. /* format is defined by AppleSingle */
  129.  
  130. #define kMailImageBodyType            'imag'        /* contains image of letter */
  131. /*        format is struct TPfPgDir - in Printing.h
  132.     *    struct TPfPgDir {
  133.     *        short    pageCount;        - number of pages in the image.
  134.     *        long    iPgPos[129];    - iPgPos[n] is the offset from the start of the block
  135.     *                                - to image of page n.
  136.     *                                - iPgPos[n+1] - iPgPos[n] is the length of page n.
  137. */
  138.  
  139. #define kMailMSAMType            'gwyi'        /* contains msam specific information */
  140.  
  141. #define kMailTunnelLtrType            'tunl'        /* used to read a tunnelled message */
  142. #define kMailHopInfoType            'hopi'        /* used to read hopInfo for a tunnelled message */
  143.  
  144. #define kMailReportType                'rpti'        /* contains report info */
  145. /*
  146. Reports have the isReport bit set in MailIndications and contain a block of type kMailReport.
  147. This block has a header, IPMReportBlockHeader,
  148. followed by an array of elements, each of type IPMRecipientReport
  149. */
  150.  
  151. /* Various families used by mail or related msgs */
  152. #define kMailFamily     'mail'    /* Defines family of "mail" msgs: content, header, etc */
  153. #define kMailFamilyFile 'file'    /* Defines family of "direct display" msgs */
  154.  
  155. /**************************************************************************************/
  156. typedef unsigned short MailAttributeID;
  157.  
  158. /* Values of MailAttributeID */
  159. /* Message store attributes - stored in the catalog */
  160. /* Will always be present in a letter and have fixed sizes */
  161. enum {
  162.     kMailLetterFlagsBit        = 1,        /* MailLetterFlags */
  163.  
  164. /* Letter attributes - stored in the letter */
  165. /* Will always be present in a letter and have fixed sizes */
  166.     kMailIndicationsBit        = 3,        /* MailIndications */
  167.     kMailMsgTypeBit            = 4,        /* OCECreatorType */
  168.     kMailLetterIDBit        = 5,        /* MailLetterID */
  169.     kMailSendTimeStampBit    = 6,        /* MailTime */
  170.     kMailNestingLevelBit    = 7,        /* MailNestingLevel */
  171.     kMailMsgFamilyBit        = 8,        /* OSType */
  172.  
  173. /* Letter attributes - stored in the letter */
  174. /* May be present in a letter and have fixed sizes */
  175.     kMailReplyIDBit                = 9,    /* MailLetterID */
  176.     kMailConversationIDBit        = 10,    /* MailLetterID */
  177.  
  178. /* Letter attributes - stored in the letter */
  179. /* May be present in a letter and have variable length sizes */
  180.     kMailSubjectBit            = 11,        /* RString */
  181.     kMailFromBit            = 12,        /* MailRecipient */
  182.     kMailToBit                = 13,        /* MailRecipient */
  183.     kMailCcBit                = 14,        /* MailRecipient */
  184.     kMailBccBit                = 15        /* MailRecipient */
  185. };
  186.  
  187. typedef unsigned long MailAttributeMask;
  188.  
  189. /* Values of MailAttributeMask */
  190. enum {
  191.     kMailLetterFlagsMask        = 1L<<(kMailLetterFlagsBit-1),
  192.     kMailIndicationsMask        = 1L<<(kMailIndicationsBit-1),
  193.     kMailMsgTypeMask            = 1L<<(kMailMsgTypeBit-1),
  194.     kMailLetterIDMask            = 1L<<(kMailLetterIDBit-1),
  195.     kMailSendTimeStampMask        = 1L<<(kMailSendTimeStampBit-1),
  196.     kMailNestingLevelMask        = 1L<<(kMailNestingLevelBit-1),
  197.     kMailMsgFamilyMask            = 1L<<(kMailMsgFamilyBit-1),
  198.     kMailReplyIDMask            = 1L<<(kMailReplyIDBit-1),
  199.     kMailConversationIDMask        = 1L<<(kMailConversationIDBit-1),
  200.     kMailSubjectMask            = 1L<<(kMailSubjectBit-1),
  201.     kMailFromMask                = 1L<<(kMailFromBit-1),
  202.     kMailToMask                    = 1L<<(kMailToBit-1),
  203.     kMailCcMask                    = 1L<<(kMailCcBit-1),
  204.     kMailBccMask                = 1L<<(kMailBccBit-1)
  205. };
  206.  
  207. struct MailAttributeBitmap {            
  208.     unsigned int
  209.         reservedA:16,
  210.         reservedB:1,
  211.         bcc:1,                            /* Boolean */
  212.         cc:1,                            /* Boolean */
  213.         to:1,                            /* Boolean */
  214.         from:1,                            /* Boolean */
  215.         subject:1,                        /* Boolean */
  216.         conversationID:1,                /* Boolean */
  217.         replyID:1,                        /* Boolean */
  218.         msgFamily:1,                    /* Boolean */
  219.         nestingLevel:1,                    /* Boolean */
  220.         sendTimeStamp:1,                /* Boolean */
  221.         letterID:1,                        /* Boolean */
  222.         msgType:1,                        /* Boolean */
  223.         indications:1,                    /* Boolean */
  224.         reservedC:1,                    /* Boolean */
  225.         letterFlags:1;                    /* Boolean */
  226. };
  227.  
  228. typedef struct MailAttributeBitmap MailAttributeBitmap;
  229.  
  230. /**************************************************************************************/
  231. typedef unsigned short MailLetterSystemFlags;
  232.  
  233. /* Values of MailLetterSystemFlags */
  234. enum {
  235.     kMailIsLocalBit =2                        /* letter is available locally (either by nature or via cache) */
  236.     
  237. };
  238. enum {
  239.     kMailIsLocalMask            = 1L<<kMailIsLocalBit
  240.  
  241. };
  242.  
  243. typedef unsigned short MailLetterUserFlags;        
  244.  
  245. enum {
  246.     kMailReadBit,                        /* this letter has been opened */
  247.     kMailDontArchiveBit,                /* this letter is not */
  248.                                         /* to be archived either because */
  249.                                         /* it has already been archived or */
  250.                                         /* it should not be archived. */
  251.     kMailInTrashBit                    /* this letter is in trash */
  252. };
  253.  
  254. /* Values of MailLetterUserFlags */
  255. enum {
  256.     kMailReadMask            = 1L<<kMailReadBit,
  257.     kMailDontArchiveMask    = 1L<<kMailDontArchiveBit,
  258.     kMailInTrashMask        = 1L<<kMailInTrashBit
  259. };
  260.  
  261. struct MailLetterFlags {
  262.     MailLetterSystemFlags sysFlags;
  263.     MailLetterUserFlags userFlags;
  264. };
  265.  
  266. typedef struct MailLetterFlags MailLetterFlags;
  267.  
  268. struct MailMaskedLetterFlags {
  269.     MailLetterFlags    flagMask;                /* flags that are to be set */
  270.     MailLetterFlags    flagValues;                /* and their values */
  271. };
  272.  
  273. typedef struct MailMaskedLetterFlags MailMaskedLetterFlags;
  274.  
  275. enum {
  276.     kMailOriginalInReportBit = 1,
  277.     kMailNonReceiptReportsBit = 3,
  278.     kMailReceiptReportsBit = 4,
  279.     kMailForwardedBit = 5,
  280.     kMailPriorityBit = 6,
  281.     kMailIsReportWithOriginalBit = 8,
  282.     kMailIsReportBit = 9,
  283.     kMailHasContentBit = 10,
  284.     kMailHasSignatureBit = 11,
  285.     kMailAuthenticatedBit = 12,
  286.     kMailSentBit = 13
  287. };
  288.  
  289. /* Values of MailIndications */
  290. enum {
  291.     kMailSentMask = 1L<<(kMailSentBit-1),
  292.     kMailAuthenticatedMask = 1L<<(kMailAuthenticatedBit-1),
  293.     kMailHasSignatureMask = 1L<<(kMailHasSignatureBit-1),
  294.     kMailHasContentMask = 1L<<(kMailHasContentBit-1),
  295.     kMailIsReportMask = 1L<<(kMailIsReportBit-1),
  296.     kMailIsReportWithOriginalMask = 1L<<(kMailIsReportWithOriginalBit-1),
  297.     kMailPriorityMask = 3L<<(kMailPriorityBit-1),
  298.     kMailForwardedMask = 1L<<(kMailForwardedBit-1),
  299.     kMailReceiptReportsMask = 1L<<(kMailReceiptReportsBit-1),
  300.     kMailNonReceiptReportsMask = 1L<<(kMailNonReceiptReportsBit-1),
  301.     kMailOriginalInReportMask = 3L<<(kMailOriginalInReportBit-1)
  302. };
  303.  
  304. struct MailIndications {
  305.     unsigned int
  306.         reservedB:16,
  307.         hasStandardContent:1,            /* this letter has standard interchange content */
  308.         hasImageContent:1,                /* this letter has a standard image */
  309.         hasNativeContent:1,                /* this letter has a main enclosure */
  310.         sent:1,                            /* this letter was sent, not just composed */
  311.         authenticated:1,                /* this letter was created and transported with authentication */
  312.         hasSignature:1,                    /* this letter was signed with a digital signature */
  313.         hasContent:1,                    /* this letter has content */
  314.         isReport:1,                        /* this letter is really a report */
  315.         isReportWithOriginal:1,            /* this report contains the original letter */
  316.  
  317.         priority:2,                        /* Bits defined as in IPMPriority */
  318.                                         /* the originator has: */
  319.         forwarded:1,                    /*        forwarded this letter */
  320.  
  321.                                         /* the originator requests: */
  322.         receiptReports:1,                /*        delivery reports */
  323.         nonReceiptReports:1,            /*        non-delivery reports */
  324.         originalInReport:2;                /*        original letter to be enclosed in reports */
  325. };
  326.  
  327. typedef struct MailIndications MailIndications;
  328.  
  329. /* values of the field originalInReport in MailIndications */
  330. enum {
  331.     kMailNoOriginal                = 0,        /* do not enclose original in reports */
  332.     kMailEncloseOnNonReceipt    = 3            /* enclose original in non-delivery reports */
  333. };
  334.  
  335. typedef IPMMsgID MailLetterID;            
  336.  
  337. struct MailTime {
  338.     UTCTime        time;                        /* current UTC(GMT) time */
  339.     UTCOffset    offset;                        /* offset from GMT */
  340. };
  341.  
  342. typedef struct MailTime MailTime;
  343.  
  344. typedef unsigned short MailNestingLevel;    /* innermost letter has nestingLevel 0 */
  345.  
  346. typedef OCERecipient MailRecipient;
  347.  
  348. /**************************************************************************************/
  349. enum {
  350.     kMailTextSegmentBit,
  351.     kMailPictSegmentBit,
  352.     kMailSoundSegmentBit,
  353.     kMailStyledTextSegmentBit,
  354.     kMailMovieSegmentBit
  355. };
  356.  
  357. typedef unsigned short MailSegmentMask;
  358.  
  359. /* Values of MailSegmentMask */
  360. enum {
  361.     kMailTextSegmentMask        = 1L<<kMailTextSegmentBit,
  362.     kMailPictSegmentMask        = 1L<<kMailPictSegmentBit,
  363.     kMailSoundSegmentMask        = 1L<<kMailSoundSegmentBit,
  364.     kMailStyledTextSegmentMask    = 1L<<kMailStyledTextSegmentBit,
  365.     kMailMovieSegmentMask        = 1L<<kMailMovieSegmentBit
  366. };
  367.  
  368. typedef unsigned short MailSegmentType;
  369.  
  370. /* Values of MailSegmentType */
  371. enum {
  372.     kMailInvalidSegmentType        = 0,
  373.     kMailTextSegmentType        = 1,
  374.     kMailPictSegmentType        = 2,
  375.     kMailSoundSegmentType        = 3,
  376.     kMailStyledTextSegmentType    = 4,
  377.     kMailMovieSegmentType        = 5
  378. };
  379.  
  380. /**************************************************************************************/
  381. #define kMailErrorLogEntryVersion 0x101        
  382. #define kMailMSAMErrorStringListID        128    /* These 'STR#' resources should be */
  383. #define kMailMSAMActionStringListID        129    /* in the PMSAM resource fork */
  384.  
  385. typedef unsigned short MailLogErrorType;
  386.  
  387. /* Values of MailLogErrorType */
  388. enum {                                    
  389.     kMailELECorrectable            = 0,
  390.     kMailELEError                = 1,            
  391.     kMailELEWarning                = 2,
  392.     kMailELEInformational        = 3
  393. };
  394.  
  395. typedef short MailLogErrorCode;
  396.  
  397. /* Values of MailLogErrorCode */
  398. enum {
  399.                                                 /* positive codes are indices into */
  400.                                                 /* PMSAM defined strings */
  401.     kMailMSAMErrorCode            = 0,            
  402.     kMailMiscError                = -1,            /* negative codes are OCE defined */
  403.     kMailNoModem                = -2            /* modem required, but missing */
  404. };
  405.  
  406. struct MailErrorLogEntryInfo {                    /* < 128 bytes */
  407.     short                version;
  408.     UTCTime                timeOccurred;            /* do not fill in */
  409.     Str31                reportingPMSAM;            /* do not fill in */
  410.     Str31                reportingMSAMSlot;    /* do not fill in */
  411.     MailLogErrorType    errorType;
  412.     MailLogErrorCode    errorCode;
  413.                         
  414.     short                errorResource;            /* resources are valid if */
  415.     short                actionResource;            /* errorCode = kMailMSAMErrorCode */
  416.                                                 /* index starts from 1 */
  417.     unsigned long        filler;
  418.     unsigned short        filler2;
  419. };
  420.  
  421. typedef struct MailErrorLogEntryInfo MailErrorLogEntryInfo;
  422.  
  423. /**************************************************************************************/
  424. typedef short MailBlockMode;            
  425.  
  426. /* Values of MailBlockMode */
  427. enum {
  428.     kMailFromStart        = 1,            /* write data from offset calculated from */
  429.     kMailFromLEOB        = 2,            /* start of block, end of block, */
  430.     kMailFromMark        = 3                /* or from the current mark */
  431. };
  432.  
  433. struct MailEnclosureInfo {
  434.     StringPtr    enclosureName;
  435.     CInfoPBPtr    catInfo;
  436.     StringPtr    comment;
  437.     Ptr            icon;
  438. };
  439.  
  440. typedef struct MailEnclosureInfo MailEnclosureInfo;
  441.  
  442. /**************************************************************************************/
  443. enum {
  444.     kOCESetupLocationNone = 0,            /* disconnect state */
  445.     kOCESetupLocationMax = 8            /* maximum location value */
  446. };
  447. typedef char OCESetupLocation;
  448.  
  449. /* location state is a bitmask, 0x1=>1st location active, 
  450.  * 0x2 => 2nd, 0x4 => 3rd, etc.
  451.  */
  452. #define MailLocationMask(locationNumber) (1<<((locationNumber)-1))
  453. typedef unsigned char MailLocationFlags;
  454.  
  455. struct MailLocationInfo {
  456.     OCESetupLocation location;
  457.     MailLocationFlags active;
  458. };
  459. typedef struct MailLocationInfo MailLocationInfo;
  460.  
  461. /**************************************************************************************/
  462. /* Definitions for Personal MSAMs */
  463. /**************************************************************************************/
  464.  
  465. #define kMailEPPCMsgVersion            3    
  466.  
  467. struct MailEPPCMsg {
  468.     short     version;
  469.     union {
  470.         SMCA     *theSMCA;                /* for 'crsl', 'mdsl', 'dlsl', 'sndi', 'msgo', 'admn' */
  471.         long    sequenceNumber;            /* for 'inqu', 'dlom' */
  472.         MailLocationInfo locationInfo;    /* for 'locc' */
  473.     } u;
  474. };
  475.  
  476. typedef struct MailEPPCMsg MailEPPCMsg;
  477.  
  478. /* Values of OCE defined High Level Event message classes */
  479. enum {                                    
  480.     kMailEPPCCreateSlot            = 'crsl',
  481.     kMailEPPCModifySlot            = 'mdsl',
  482.     kMailEPPCDeleteSlot            = 'dlsl',
  483.     kMailEPPCShutDown            = 'quit',
  484.     kMailEPPCMailboxOpened        = 'mbop',
  485.     kMailEPPCMailboxClosed        = 'mbcl',
  486.     kMailEPPCMsgPending            = 'msgp',
  487.     kMailEPPCSendImmediate        = 'sndi',
  488.     kMailEPPCContinue            = 'cont',
  489.     kMailEPPCSchedule            = 'sked',
  490.     kMailEPPCAdmin                = 'admn',
  491.     kMailEPPCInQUpdate            = 'inqu',
  492.     kMailEPPCMsgOpened            = 'msgo',
  493.     kMailEPPCDeleteOutQMsg        = 'dlom',
  494.     kMailEPPCWakeup                = 'wkup',
  495.     kMailEPPCLocationChanged    = 'locc'
  496. };
  497.  
  498. union MailTimer {
  499.     long                frequency;        /* how often to connect */
  500.     long                connectTime;    /* time since midnight */
  501. };
  502.  
  503. typedef union MailTimer MailTimer;
  504.  
  505. enum {
  506.     kMailTimerOff        = 0,            /* control is off */
  507.     kMailTimerTime        = 1,            /* specifies connect time (relative to midnight) */
  508.     kMailTimerFrequency    = 2                /* specifies connect frequency */
  509. };
  510.  
  511. typedef Byte MailTimerKind;
  512.  
  513. struct MailTimers {
  514.     MailTimerKind    sendTimeKind;        /* either kMailTimerTime or kMailTimerFrequency */
  515.     MailTimerKind    receiveTimeKind;    /* either kMailTimerTime or kMailTimerFrequency */
  516.     MailTimer        send;
  517.     MailTimer        receive;
  518. };
  519.  
  520. typedef struct MailTimers MailTimers;
  521.  
  522.  
  523. struct MailStandardSlotInfoAttribute {
  524.     short                version;
  525.     MailLocationFlags    active;                /* active if MailLocationMask(i) is set */
  526.     Byte                padByte;
  527.     MailTimers            sendReceiveTimer;
  528. };
  529.  
  530. typedef struct MailStandardSlotInfoAttribute MailStandardSlotInfoAttribute;
  531.  
  532. struct PMSAMGetMSAMRecordPB {
  533.     MailParamBlockHeader
  534.     CreationID            msamCID;    
  535. };
  536.  
  537. typedef struct PMSAMGetMSAMRecordPB PMSAMGetMSAMRecordPB;
  538.  
  539. struct PMSAMOpenQueuesPB {
  540.     MailParamBlockHeader
  541.     MSAMQueueRef        inQueueRef;
  542.     MSAMQueueRef        outQueueRef;
  543.     MSAMSlotID            msamSlotID;
  544.     long                filler[2];
  545. };
  546.  
  547. typedef struct PMSAMOpenQueuesPB PMSAMOpenQueuesPB;
  548.  
  549. typedef unsigned short PMSAMStatus;
  550.  
  551. /* Values of PMSAMStatus */
  552. enum {
  553.     kPMSAMStatusPending    = 1,    /* for inQueue and outQueue */
  554.     kPMSAMStatusError    = 2,    /* for inQueue and outQueue */
  555.     kPMSAMStatusSending    = 3,    /* for outQueue only */
  556.     kPMSAMStatusCaching    = 4,    /* for inQueue only */
  557.     kPMSAMStatusSent    = 5        /* for outQueue only */
  558.     
  559. };
  560.  
  561. struct PMSAMSetStatusPB {
  562.     MailParamBlockHeader
  563.     MSAMQueueRef        queueRef;
  564.     long                seqNum;
  565.     long                msgHint;    /* for posting cache error,set this to 0 when report outq status */
  566.     PMSAMStatus            status;    
  567. };
  568.  
  569. typedef struct PMSAMSetStatusPB PMSAMSetStatusPB;
  570.  
  571. struct PMSAMLogErrorPB {
  572.     MailParamBlockHeader
  573.     MSAMSlotID            msamSlotID;    /* 0 for PMSAM errors */
  574.     MailErrorLogEntryInfo    *logEntry;
  575.     long                    filler[2];
  576. };
  577.  
  578. typedef struct PMSAMLogErrorPB PMSAMLogErrorPB;
  579.  
  580. /****************************************************************************************/
  581.  
  582. #define kMailMsgSummaryVersion    1
  583.  
  584. struct MailMasterData {
  585.     MailAttributeBitmap        attrMask;        /* indicates attributes present in MsgSummary */
  586.     MailLetterID            messageID;
  587.     MailLetterID            replyID;
  588.     MailLetterID            conversationID;
  589. };
  590. typedef struct MailMasterData MailMasterData;
  591.  
  592. struct MailCoreData {
  593.     MailLetterFlags            letterFlags;
  594.     unsigned long            messageSize;
  595.     MailIndications            letterIndications;
  596.     OCECreatorType            messageType;
  597.     MailTime                sendTime;
  598.     OSType                    messageFamily;
  599.     unsigned char            reserved;
  600.     unsigned char            addressedToMe;
  601. #define kAddressedAs_TO 0x1
  602. #define kAddressedAs_CC 0x2
  603. #define kAddressedAs_BCC 0x4
  604.     char                    agentInfo[6];    /* 6 bytes of special info [set to zero] */
  605.     /* these are variable length and even padded */
  606.     RString32                sender;            /* recipient's entityName (trunc)*/
  607.     RString32                subject;        /* subject maybe truncated */
  608. };
  609. typedef struct MailCoreData MailCoreData;
  610.  
  611. struct MSAMMsgSummary {
  612.     short                    version;        /* following flags are defaulted by Toolbox */
  613.     Boolean                    msgDeleted;        /* true if msg is to be deleted by PMSAM */
  614.     Boolean                    msgUpdated;        /* true if msgSummary was updated by MailManager */
  615.     Boolean                    msgCached;        /* true if msg is in the slot's InQueue */
  616.     Byte                    padByte;
  617.     
  618.     MailMasterData            masterData;
  619.     MailCoreData            coreData;
  620. };
  621.  
  622. typedef struct MSAMMsgSummary MSAMMsgSummary;
  623.  
  624. #define kMailMaxPMSAMMsgSummaryData 128    /* PMSAM can put up to 128 bytes of private msg summary data */
  625.  
  626. struct PMSAMCreateMsgSummaryPB {
  627.     MailParamBlockHeader
  628.     MSAMQueueRef        inQueueRef;    
  629.     long                seqNum;            /* <- seq of the new message */
  630.     MSAMMsgSummary*        msgSummary;        /* attributes and mask filled in */
  631.     MailBuffer*            buffer;            /* PMSAM specific data to be appended */
  632. };
  633.  
  634. typedef struct PMSAMCreateMsgSummaryPB PMSAMCreateMsgSummaryPB;
  635.  
  636.  
  637. struct PMSAMPutMsgSummaryPB {
  638.     MailParamBlockHeader
  639.     MSAMQueueRef            inQueueRef;        
  640.     long                    seqNum;            
  641.     MailMaskedLetterFlags*     letterFlags;    /* if not nil, then set msgStoreFlags */
  642.     MailBuffer*                buffer;            /* PMSAM specific data to be overwritten */
  643. };
  644.  
  645. typedef struct PMSAMPutMsgSummaryPB PMSAMPutMsgSummaryPB;
  646.  
  647. struct PMSAMGetMsgSummaryPB {
  648.     MailParamBlockHeader
  649.     MSAMQueueRef        inQueueRef;        
  650.     long                seqNum;            
  651.     MSAMMsgSummary *    msgSummary;            /* if not nil, then read in the msgSummary */
  652.     MailBuffer*            buffer;                /* PMSAM specific data to be read */
  653.     unsigned short        msgSummaryOffset;    /* offset of PMSAM specific data  */
  654.                                             /* from start of MsgSummary */
  655. };
  656.  
  657. typedef struct PMSAMGetMsgSummaryPB PMSAMGetMsgSummaryPB;
  658.  
  659. /****************************************************************************************/
  660. /* Definitions for Server MSAMs */
  661. /**************************************************************************************/
  662.  
  663. typedef unsigned short SMSAMAdminCode;
  664.  
  665. /* Values of SMSAMAdminCode */
  666. enum {                                    
  667.     kSMSAMNotifyFwdrSetupChange        = 1,
  668.     kSMSAMNotifyFwdrNameChange        = 2,
  669.     kSMSAMNotifyFwdrPwdChange            = 3,
  670.     kSMSAMGetDynamicFwdrParams        = 4
  671. };
  672.  
  673. typedef unsigned long SMSAMSlotChanges;
  674.  
  675. enum {
  676.     kSMSAMFwdrHomeInternetChangedBit,
  677.     kSMSAMFwdrConnectedToChangedBit,
  678.     kSMSAMFwdrForeignRLIsChangedBit,
  679.     kSMSAMFwdrMnMServerChangedBit
  680. };
  681.  
  682. /* Values of SMSAMSlotChanges */
  683. enum {                                    
  684.     kSMSAMFwdrEverythingChangedMask        = -1,
  685.     kSMSAMFwdrHomeInternetChangedMask        = 1L<<kSMSAMFwdrHomeInternetChangedBit,
  686.     kSMSAMFwdrConnectedToChangedMask        = 1L<<kSMSAMFwdrConnectedToChangedBit,
  687.     kSMSAMFwdrForeignRLIsChangedMask        = 1L<<kSMSAMFwdrForeignRLIsChangedBit,
  688.     kSMSAMFwdrMnMServerChangedMask        = 1L<<kSMSAMFwdrMnMServerChangedBit
  689. };
  690.  
  691. struct SMSAMSetupChange {                    /* kSMSAMNotifyFwdrSetupChange */
  692.     SMSAMSlotChanges    whatChanged;        /*  --> bitmap of what parameters changed */
  693.     AddrBlock        serverHint;            /*  --> try this ADAP server first */
  694. };
  695.  
  696. typedef struct SMSAMSetupChange SMSAMSetupChange;
  697.  
  698. struct SMSAMNameChange {                    /* kSMSAMNotifyFwdrNameChange */
  699.     RString                newName;        /*  --> msams new name */
  700.     AddrBlock            serverHint;        /*  --> try this ADAP server first */
  701. };
  702.  
  703. typedef struct SMSAMNameChange SMSAMNameChange;
  704.  
  705. struct SMSAMPasswordChange {                /* kSMSAMNotifyFwdrPasswordChange */
  706.     RString                newPassword;    /*  --> msams new password */
  707.     AddrBlock            serverHint;        /*  --> try this ADAP server first */
  708. };
  709.  
  710. typedef struct SMSAMPasswordChange SMSAMPasswordChange;
  711.  
  712. struct SMSAMDynamicParams {                /* kSMSAMGetDynamicFwdrParams */
  713.     unsigned long    curDiskUsed;        /* <--  amount of disk space used by msam */
  714.     unsigned long    curMemoryUsed;        /* <--  amount of memory used by msam */
  715. };
  716.  
  717. typedef struct SMSAMDynamicParams SMSAMDynamicParams;
  718.  
  719. struct SMSAMAdminEPPCRequest {                
  720.     SMSAMAdminCode    adminCode;
  721.     union {
  722.         SMSAMSetupChange        setupChange;
  723.         SMSAMNameChange        nameChange;
  724.         SMSAMPasswordChange    passwordChange;
  725.         SMSAMDynamicParams    dynamicParams;
  726.     } u;
  727. };
  728.  
  729. typedef struct SMSAMAdminEPPCRequest SMSAMAdminEPPCRequest;
  730.  
  731. struct SMSAMSetupPB {
  732.     MailParamBlockHeader
  733.     RecordIDPtr    serverMSAM;
  734.     RStringPtr    password;
  735.     OSType        gatewayType;
  736.     RStringPtr    gatewayTypeDescription;
  737.     AddrBlock    catalogServerHint;
  738. };
  739. typedef struct SMSAMSetupPB SMSAMSetupPB;
  740.  
  741. struct SMSAMStartupPB {
  742.     MailParamBlockHeader
  743.     AuthIdentity        msamIdentity;
  744.     MSAMQueueRef        queueRef;
  745. };
  746.  
  747. typedef struct SMSAMStartupPB SMSAMStartupPB;
  748.  
  749. struct SMSAMShutdownPB {
  750.     MailParamBlockHeader
  751.     MSAMQueueRef        queueRef;
  752. };
  753.  
  754. typedef struct SMSAMShutdownPB SMSAMShutdownPB;
  755.  
  756. /****************************************************************************************/
  757. /* Definitions for reading and writing MSAM Letters */
  758. /****************************************************************************************/
  759.  
  760. struct MSAMEnumeratePB {
  761.     MailParamBlockHeader
  762.     MSAMQueueRef        queueRef;
  763.     long                startSeqNum;
  764.     long                nextSeqNum;
  765.     MailBuffer            buffer;
  766.     /* buffer contains a Mail Reply. Each tuple is a 
  767.     MSAMEnumerateInQReply when enumerating the inQueue
  768.     MSAMEnumerateOutQReply when enumerating the outQueue 
  769.     */
  770. };
  771.  
  772. typedef struct MSAMEnumeratePB MSAMEnumeratePB;
  773.  
  774. struct MSAMEnumerateInQReply {
  775.     long                seqNum;
  776.     Boolean                msgDeleted;        /* true if msg is to be deleted by PMSAM */
  777.     Boolean                msgUpdated;        /* true if MsgSummary has been updated by TB */
  778.     Boolean                msgCached;        /* true if msg is in the incoming queue */
  779.     Byte                padByte;
  780. };
  781.  
  782. typedef struct MSAMEnumerateInQReply MSAMEnumerateInQReply;
  783.  
  784. struct MSAMEnumerateOutQReply {
  785.     long            seqNum;
  786.     Boolean            done;                /* true if all responsible recipients have been processed */
  787.     IPMPriority        priority;
  788.     OSType            msgFamily;
  789.     long            approxSize;
  790.     Boolean            tunnelForm;            /* true if this letter has to be tunnelled */
  791.     Byte            padByte;
  792.     NetworkSpec        nextHop;            /* valid if tunnelForm is true */
  793.     OCECreatorType    msgType;
  794. };
  795.  
  796. typedef struct MSAMEnumerateOutQReply MSAMEnumerateOutQReply;
  797.  
  798. struct MSAMDeletePB {
  799.     MailParamBlockHeader
  800.     MSAMQueueRef        queueRef;
  801.     long                seqNum;
  802.     Boolean                msgOnly;        /* only valid for PMSAM & inQueue */
  803.                                         /* set true to delete message but not msgSummary */
  804.     Byte                padByte;
  805.     OSErr                result;            /* only valid for SMSAM & tunnelled messages */
  806. };
  807.  
  808. typedef struct MSAMDeletePB MSAMDeletePB;
  809.  
  810. struct MSAMOpenPB {                        
  811.     MailParamBlockHeader
  812.     MSAMQueueRef        queueRef;
  813.     long                seqNum;
  814.     MailMsgRef            mailMsgRef;
  815. };
  816.  
  817. typedef struct MSAMOpenPB MSAMOpenPB;
  818.  
  819. struct MSAMOpenNestedPB {                
  820.     MailParamBlockHeader
  821.     MailMsgRef            mailMsgRef;
  822.     MailMsgRef            nestedRef;
  823. };
  824.  
  825. typedef struct MSAMOpenNestedPB MSAMOpenNestedPB;
  826.  
  827. struct MSAMClosePB {
  828.     MailParamBlockHeader
  829.     MailMsgRef            mailMsgRef;
  830. };
  831.  
  832. typedef struct MSAMClosePB MSAMClosePB;
  833.  
  834. struct MSAMGetMsgHeaderPB {
  835.     MailParamBlockHeader
  836.     MailMsgRef            mailMsgRef;
  837.     IPMHeaderSelector    selector;
  838.     unsigned long        offset;
  839.     MailBuffer            buffer;
  840.     unsigned long        remaining;
  841. };
  842.  
  843. typedef struct MSAMGetMsgHeaderPB MSAMGetMsgHeaderPB;
  844.  
  845. struct MSAMGetAttributesPB {
  846.     MailParamBlockHeader
  847.     MailMsgRef            mailMsgRef;
  848.     MailAttributeBitmap    requestMask;    /* kMailIndicationsBit thru kMailSubjectBit */
  849.     MailBuffer            buffer;
  850.     /*    buffer returned will contain the attribute values of 
  851.         the attributes indicated in responseMask, 
  852.         from the attribute indicated by the least significant bit set
  853.         to the attribute indicated by the most significant bit set.
  854.         Note that recipients - from, to, cc, bcc cannot be read using
  855.         this call. Use GetRecipients to read these.
  856.     */
  857.     MailAttributeBitmap    responseMask;
  858.     Boolean                more;
  859. };
  860.  
  861. typedef struct MSAMGetAttributesPB MSAMGetAttributesPB;
  862.  
  863. #define kMailResolvedList 0                /* attrID value to get resolved recipient list */
  864.  
  865.  
  866. struct MailOriginalRecipient {
  867.     short                index;
  868.     /* Followed by OCEPackedRecipient */
  869. };
  870.  
  871. typedef struct MailOriginalRecipient MailOriginalRecipient;
  872.  
  873.  
  874. struct MailResolvedRecipient {
  875.     short                index;
  876.     short                recipientFlags;
  877.     Boolean                responsible;
  878.     Byte                padByte;
  879.     /* Followed by OCEPackedRecipient */
  880. };
  881.  
  882. typedef struct MailResolvedRecipient MailResolvedRecipient;
  883.  
  884.     
  885. struct MSAMGetRecipientsPB {
  886.     MailParamBlockHeader
  887.     MailMsgRef            mailMsgRef;
  888.     MailAttributeID        attrID;            /* kMailFromBit thru kMailBccBit */    
  889.     unsigned short        startIndex;        /* starts at 1 */
  890.     MailBuffer            buffer;
  891.     /*     buffer contains a Mail Reply. Each tuple is a
  892.         MailOriginalRecipient if getting original recipients 
  893.                                 ie the attrID is kMail[From, To, Cc, Bcc]Bit
  894.         MailResolvedRecipient if getting resolved reicpients
  895.                                 ie the attrID is kMailResolvedList
  896.         Both tuples are word alligned. 
  897.     */
  898.  
  899.     unsigned short        nextIndex;
  900.     Boolean                more;
  901. };
  902.  
  903. typedef struct MSAMGetRecipientsPB MSAMGetRecipientsPB;
  904.  
  905. struct MSAMGetContentPB {
  906.     MailParamBlockHeader
  907.     MailMsgRef            mailMsgRef;
  908.     MailSegmentMask        segmentMask;
  909.     MailBuffer            buffer;
  910.     StScrpRec            *textScrap;
  911.     ScriptCode            script;
  912.     MailSegmentType        segmentType;
  913.     Boolean                endOfScript;
  914.     Boolean                endOfSegment;
  915.     Boolean                endOfContent;
  916.     long                segmentLength;        /* NEW: <-  valid first call in a segment */
  917.     long                segmentID;            /* NEW: <-> identifier for this segment */
  918. };
  919.  
  920. typedef struct MSAMGetContentPB MSAMGetContentPB;
  921.  
  922. struct MSAMGetEnclosurePB {
  923.     MailParamBlockHeader
  924.     MailMsgRef            mailMsgRef;
  925.     Boolean                contentEnclosure;
  926.     Byte                padByte;
  927.     MailBuffer            buffer;
  928.     Boolean                endOfFile;
  929.     Boolean                endOfEnclosures;
  930. };
  931.  
  932. typedef struct MSAMGetEnclosurePB MSAMGetEnclosurePB;
  933.  
  934. struct MailBlockInfo {
  935.     OCECreatorType        blockType;
  936.     unsigned long        offset;
  937.     unsigned long        blockLength;
  938. };
  939.  
  940. typedef struct MailBlockInfo MailBlockInfo;
  941.  
  942. struct MSAMEnumerateBlocksPB {
  943.     MailParamBlockHeader
  944.     MailMsgRef            mailMsgRef;
  945.     unsigned short        startIndex;        /* starts at 1 */
  946.     MailBuffer            buffer;
  947.     /*     buffer contains a Mail Reply. Each tuple is a MailBlockInfo */
  948.     unsigned short        nextIndex;
  949.     Boolean                more;
  950. };
  951.  
  952. typedef struct MSAMEnumerateBlocksPB MSAMEnumerateBlocksPB;
  953.  
  954. struct MSAMGetBlockPB {
  955.     MailParamBlockHeader
  956.     MailMsgRef            mailMsgRef;
  957.     OCECreatorType        blockType;
  958.     unsigned short        blockIndex;
  959.     MailBuffer            buffer;
  960.     unsigned long        dataOffset;
  961.     Boolean                endOfBlock;
  962.     Byte                padByte;
  963.     unsigned long        remaining;
  964. };
  965.  
  966. typedef struct MSAMGetBlockPB MSAMGetBlockPB;
  967.  
  968. /* YOU SHOULD BE USING THE NEW FORM OF MARK RECIPIENTS
  969.  * THIS VERSION IS MUCH SLOWER AND KEPT FOR COMPATIBILITY
  970.  * REASONS.
  971. */
  972. struct MSAMMarkRecipientsPB {            /* not valid for tunnel form letters */
  973.     MailParamBlockHeader
  974.     MSAMQueueRef        queueRef;
  975.     long                seqNum;
  976.     MailBuffer            buffer;
  977.     /*     buffer contains a Mail Reply. Each tuple is an unsigned short,
  978.         the index of a recipient to be marked. 
  979.     */
  980. };
  981. typedef struct MSAMMarkRecipientsPB MSAMMarkRecipientsPB;
  982.  
  983. /* 
  984.  * same as MSAMMarkRecipients except it takes a mailMsgRef instead of 
  985.  * queueRef, seqNum 
  986. */
  987. struct MSAMnMarkRecipientsPB {            /* not valid for tunnel form letters */
  988.     MailParamBlockHeader
  989.     MailMsgRef            mailMsgRef;
  990.     MailBuffer            buffer;
  991.     /*     buffer contains a Mail Reply. Each tuple is an unsigned short,
  992.         the index of a recipient to be marked. 
  993.     */
  994. };
  995. typedef struct MSAMnMarkRecipientsPB MSAMnMarkRecipientsPB;
  996. /****************************************************************************************/
  997. struct MSAMCreatePB {                        
  998.     MailParamBlockHeader
  999.     MSAMQueueRef        queueRef;
  1000.     Boolean                asLetter;        /* indicate if we should create as letter or msg */
  1001.     IPMMsgType            msgType;        /* up to application discretion: must be of IPMSenderTag */
  1002.                                         /* kIPMOSFormatType for asLetter=true */
  1003.     long                refCon;            /* for messages only */
  1004.     long                seqNum;            /* set if creating message in the inQueue */
  1005.     Boolean                tunnelForm;        /* if true tunnelForm else newForm */
  1006.     Boolean                bccRecipients;    /* true if creating letter with bcc recipients */
  1007.     MailMsgRef            newRef;
  1008. };
  1009.  
  1010. typedef struct MSAMCreatePB MSAMCreatePB;
  1011.  
  1012. struct MSAMBeginNestedPB {        
  1013.     MailParamBlockHeader
  1014.     MailMsgRef            mailMsgRef;
  1015.     long                refCon;            /* for messages only */
  1016.     IPMMsgType            msgType;
  1017. };
  1018.  
  1019. typedef struct MSAMBeginNestedPB MSAMBeginNestedPB;
  1020.  
  1021. struct MSAMEndNestedPB {            
  1022.     MailParamBlockHeader
  1023.     MailMsgRef            mailMsgRef;
  1024. };
  1025.  
  1026. typedef struct MSAMEndNestedPB MSAMEndNestedPB;
  1027.  
  1028. struct MSAMSubmitPB {                        
  1029.     MailParamBlockHeader
  1030.     MailMsgRef            mailMsgRef;
  1031.     Boolean                submitFlag;
  1032.     Byte                padByte;
  1033.     MailLetterID        msgID;            
  1034. };
  1035.  
  1036. typedef struct MSAMSubmitPB MSAMSubmitPB;
  1037.  
  1038. struct MSAMPutMsgHeaderPB {
  1039.     MailParamBlockHeader
  1040.     MailMsgRef            mailMsgRef;
  1041.     OCERecipient*        replyQueue;
  1042.     IPMSender*            sender;
  1043.     IPMNotificationType    deliveryNotification;
  1044.     IPMPriority            priority;
  1045. };
  1046.  
  1047. typedef struct MSAMPutMsgHeaderPB MSAMPutMsgHeaderPB;
  1048.  
  1049. struct MSAMPutAttributePB {
  1050.     MailParamBlockHeader
  1051.     MailMsgRef            mailMsgRef;
  1052.     MailAttributeID        attrID;            /* kMailIndicationsBit thru kMailSubjectBit */
  1053.     MailBuffer            buffer;
  1054. };
  1055.  
  1056. typedef struct MSAMPutAttributePB MSAMPutAttributePB;
  1057.  
  1058. struct MSAMPutRecipientPB {
  1059.     MailParamBlockHeader
  1060.     MailMsgRef            mailMsgRef;
  1061.     MailAttributeID        attrID;            /* kMailFromBit thru kMailBccBit */
  1062.     MailRecipient        *recipient;
  1063.     Boolean                responsible;    /* valid for server and message msams only */
  1064. };
  1065.  
  1066. typedef struct MSAMPutRecipientPB MSAMPutRecipientPB;
  1067.  
  1068. struct MSAMPutContentPB {
  1069.     MailParamBlockHeader
  1070.     MailMsgRef            mailMsgRef;
  1071.     MailSegmentType    segmentType;
  1072.     Boolean                append;
  1073.     Byte                padByte;
  1074.     MailBuffer            buffer;
  1075.     StScrpRec            *textScrap;
  1076.     Boolean                startNewScript;
  1077.     ScriptCode            script;        /* valid only if startNewScript is true */
  1078. };
  1079.  
  1080. typedef struct MSAMPutContentPB MSAMPutContentPB;
  1081.  
  1082. struct MSAMPutEnclosurePB {                
  1083.     MailParamBlockHeader
  1084.     MailMsgRef            mailMsgRef;
  1085.     Boolean                contentEnclosure;
  1086.     Byte                padByte;
  1087.     Boolean                hfs;            /* true => in file system, false => in memory */
  1088.  
  1089.     Boolean                append;
  1090.     MailBuffer            buffer;            /* Unused if hfs == true */
  1091.     FSSpec                enclosure;
  1092.     MailEnclosureInfo    addlInfo;
  1093. };
  1094.  
  1095. typedef struct MSAMPutEnclosurePB MSAMPutEnclosurePB;
  1096.  
  1097. struct MSAMPutBlockPB {
  1098.     MailParamBlockHeader
  1099.     MailMsgRef            mailMsgRef;
  1100.     long                refCon;            /* for messages only */
  1101.     OCECreatorType        blockType;
  1102.     Boolean                append;
  1103.     MailBuffer            buffer;
  1104.     MailBlockMode        mode;        /* if blockType is kMailTunnelLtrType or kMailHopInfoType */
  1105.                                     /* mode is assumed to be kMailFromMark */
  1106.     unsigned long        offset;
  1107. };
  1108.  
  1109. typedef struct MSAMPutBlockPB MSAMPutBlockPB;
  1110.  
  1111. /****************************************************************************************/
  1112. struct MSAMCreateReportPB {
  1113.     MailParamBlockHeader
  1114.     MSAMQueueRef        queueRef;        /* to distinguish personal and server MSAMs */
  1115.     MailMsgRef            mailMsgRef;
  1116.     MailLetterID        msgID;            /* kMailLetterIDBit of letter being reported upon */
  1117.     MailRecipient        *sender;        /* sender of the letter you are creating report on */
  1118. };
  1119.  
  1120. typedef struct MSAMCreateReportPB MSAMCreateReportPB;
  1121.  
  1122. struct MSAMPutRecipientReportPB {
  1123.     MailParamBlockHeader
  1124.     MailMsgRef            mailMsgRef;
  1125.     short                recipientIndex;    /* recipient index in the original letter */
  1126.     OSErr                result;            /* result of sending the recipient */
  1127. };
  1128.  
  1129. typedef struct MSAMPutRecipientReportPB MSAMPutRecipientReportPB;
  1130.  
  1131. /****************************************************************************************/
  1132.  
  1133. struct MailWakeupPMSAMPB {                    
  1134.     MailParamBlockHeader
  1135.     CreationID            pmsamCID;
  1136.     MailSlotID            mailSlotID;            
  1137. };
  1138.  
  1139. typedef struct MailWakeupPMSAMPB MailWakeupPMSAMPB;
  1140.  
  1141. struct MailCreateMailSlotPB {
  1142.     MailParamBlockHeader
  1143.     MailboxRef            mailboxRef;
  1144.     long                timeout;            
  1145.     CreationID            pmsamCID;        
  1146.     SMCA                smca;
  1147. };
  1148.  
  1149. typedef struct MailCreateMailSlotPB MailCreateMailSlotPB;
  1150.  
  1151. struct MailModifyMailSlotPB {
  1152.     MailParamBlockHeader
  1153.     MailboxRef            mailboxRef;
  1154.     long                timeout;
  1155.     CreationID            pmsamCID;        
  1156.     SMCA                smca;
  1157. };
  1158.  
  1159. typedef struct MailModifyMailSlotPB MailModifyMailSlotPB;
  1160.  
  1161.  
  1162. /****************************************************************************************/
  1163.  
  1164. #define kPMSAMGetMSAMRecord    1286
  1165. #define kPMSAMOpenQueues            1280    
  1166. #define kPMSAMLogError            1313
  1167. #define kPMSAMSetStatus            1319
  1168.  
  1169. #define kPMSAMCreateMsgSummary            1314
  1170. #define kPMSAMPutMsgSummary            1317
  1171. #define kPMSAMGetMsgSummary            1318
  1172.  
  1173. #define kMailWakeupPMSAM            1287
  1174.  
  1175. #define kSMSAMSetup                1315
  1176. #define kSMSAMStartup                1281    
  1177. #define kSMSAMShutdown            1282
  1178.  
  1179. #define kMSAMEnumerate            1283    
  1180. #define kMSAMDelete                1284
  1181.  
  1182. #define kMSAMOpen                    1288
  1183. #define kMSAMOpenNested            1289
  1184. #define kMSAMClose                1290
  1185. #define kMSAMGetMsgHeader            1297
  1186. #define kMSAMnMarkRecipients        1298
  1187.  
  1188. #define kMSAMGetAttributes        1291
  1189. #define kMSAMGetRecipients        1292
  1190. #define kMSAMGetContent            1293
  1191. #define kMSAMGetEnclosure            1294
  1192. #define kMSAMEnumerateBlocks        1295
  1193. #define kMSAMGetBlock                1296
  1194. #define kMSAMMarkRecipients        1285
  1195.  
  1196. #define kMSAMCreate                1300    
  1197. #define kMSAMBeginNested            1301
  1198. #define kMSAMEndNested            1302
  1199. #define kMSAMSubmit                1303
  1200. #define kMSAMPutMsgHeader            1309
  1201. #define kMSAMPutAttribute            1304
  1202. #define kMSAMPutRecipient            1305
  1203. #define kMSAMPutContent            1306
  1204. #define kMSAMPutEnclosure            1307
  1205. #define kMSAMPutBlock                1308
  1206.  
  1207. #define kMSAMCreateReport            1311    
  1208. #define kMSAMPutRecipientReport    1312
  1209.  
  1210. #define kMailCreateMailSlot            1323
  1211. #define kMailModifyMailSlot            1324
  1212.  
  1213. union MSAMParam {
  1214.     struct {MailParamBlockHeader} header;
  1215.  
  1216.     PMSAMGetMSAMRecordPB    pmsamGetMSAMRecord;
  1217.     PMSAMOpenQueuesPB            pmsamOpenQueues;        
  1218.     PMSAMSetStatusPB            pmsamSetStatus;
  1219.     PMSAMLogErrorPB            pmsamLogError;
  1220.  
  1221.  
  1222.     SMSAMSetupPB            smsamSetup;                
  1223.     SMSAMStartupPB            smsamStartup;                
  1224.     SMSAMShutdownPB            smsamShutdown;
  1225.  
  1226.     MSAMEnumeratePB            msamEnumerate;            
  1227.     MSAMDeletePB                msamDelete;
  1228.  
  1229.     MSAMOpenPB                msamOpen;
  1230.     MSAMOpenNestedPB            msamOpenNested;
  1231.     MSAMClosePB                msamClose;
  1232.     MSAMGetMsgHeaderPB        msamGetMsgHeader;
  1233.     MSAMGetAttributesPB        msamGetAttributes;
  1234.     MSAMGetRecipientsPB        msamGetRecipients;
  1235.     MSAMGetContentPB            msamGetContent;
  1236.     MSAMGetEnclosurePB        msamGetEnclosure;
  1237.     MSAMEnumerateBlocksPB        msamEnumerateBlocks;
  1238.     MSAMGetBlockPB            msamGetBlock;
  1239.     MSAMMarkRecipientsPB        msamMarkRecipients;
  1240.     MSAMnMarkRecipientsPB        msamnMarkRecipients;
  1241.  
  1242.     MSAMCreatePB                msamCreate;                
  1243.     MSAMBeginNestedPB            msamBeginNested;
  1244.     MSAMEndNestedPB            msamEndNested;
  1245.     MSAMSubmitPB                msamSubmit;
  1246.     MSAMPutMsgHeaderPB        msamPutMsgHeader;
  1247.     MSAMPutAttributePB        msamPutAttribute;
  1248.     MSAMPutRecipientPB        msamPutRecipient;
  1249.     MSAMPutContentPB            msamPutContent;
  1250.     MSAMPutEnclosurePB        msamPutEnclosure;
  1251.     MSAMPutBlockPB            msamPutBlock;
  1252.  
  1253.     MSAMCreateReportPB        msamCreateReport;            /* Reports and Error Handling Calls */
  1254.     MSAMPutRecipientReportPB    msamPutRecipientReport;
  1255.  
  1256.     PMSAMCreateMsgSummaryPB        pmsamCreateMsgSummary;
  1257.     PMSAMPutMsgSummaryPB            pmsamPutMsgSummary;
  1258.     PMSAMGetMsgSummaryPB            pmsamGetMsgSummary;
  1259.  
  1260.     MailWakeupPMSAMPB                wakeupPMSAM;
  1261.     MailCreateMailSlotPB        createMailSlot;
  1262.     MailModifyMailSlotPB        modifyMailSlot;
  1263. };
  1264.  
  1265. typedef union MSAMParam MSAMParam;
  1266.  
  1267.  
  1268. #ifdef __cplusplus
  1269. extern "C" {
  1270. #endif
  1271.  
  1272. pascal OSErr MailCreateMailSlot(MSAMParam *paramBlock)     /* ASYNCHRONOUS ONLY, client must call WaitNextEvent */
  1273.     = {0x7001, 0x1f00, 0x3f3c, kMailCreateMailSlot, _oceTBDispatch};
  1274. pascal OSErr MailModifyMailSlot(MSAMParam *paramBlock)     /* ASYNCHRONOUS ONLY, client must call WaitNextEvent */
  1275.     = {0x7001, 0x1f00, 0x3f3c, kMailModifyMailSlot, _oceTBDispatch};
  1276. pascal OSErr MailWakeupPMSAM(MSAMParam *paramBlock)  /* ASYNCHRONOUS ONLY, client must call WaitNextEvent */
  1277.     = {0x7001, 0x1f00, 0x3f3c, kMailWakeupPMSAM, _oceTBDispatch};
  1278.  
  1279. /* Personal MSAM Glue Routines */
  1280. pascal OSErr PMSAMOpenQueues(MSAMParam *paramBlock)
  1281.     = {0x7000, 0x1f00, 0x3f3c, kPMSAMOpenQueues, _oceTBDispatch};
  1282. pascal OSErr PMSAMSetStatus(MSAMParam *paramBlock, Boolean asyncFlag)
  1283.     = {0x3f3c, kPMSAMSetStatus, _oceTBDispatch};
  1284. pascal OSErr PMSAMGetMSAMRecord(MSAMParam *paramBlock)    /* SYNC ONLY */
  1285.     = {0x7000, 0x1f00, 0x3f3c, kPMSAMGetMSAMRecord, _oceTBDispatch};
  1286.  
  1287. /* Server MSAM Glue Routines */
  1288. pascal OSErr SMSAMSetup(MSAMParam *paramBlock)    /* SYNC ONLY */
  1289.     = {0x7000, 0x1f00, 0x3f3c, kSMSAMSetup, _oceTBDispatch};
  1290. pascal OSErr SMSAMStartup(MSAMParam *paramBlock)    /* SYNC ONLY */
  1291.     = {0x7000, 0x1f00, 0x3f3c, kSMSAMStartup, _oceTBDispatch};
  1292. pascal OSErr SMSAMShutdown(MSAMParam *paramBlock, Boolean asyncFlag)
  1293.     = {0x3f3c, kSMSAMShutdown, _oceTBDispatch};
  1294.  
  1295. /* Get Interface Glue Routines */
  1296. pascal OSErr MSAMEnumerate(MSAMParam *paramBlock, Boolean asyncFlag)
  1297.     = {0x3f3c, kMSAMEnumerate, _oceTBDispatch};
  1298. pascal OSErr MSAMDelete(MSAMParam *paramBlock, Boolean asyncFlag)
  1299.     = {0x3f3c, kMSAMDelete, _oceTBDispatch};
  1300. pascal OSErr MSAMMarkRecipients(MSAMParam *paramBlock, Boolean asyncFlag)
  1301.     = {0x3f3c, kMSAMMarkRecipients, _oceTBDispatch};
  1302. pascal OSErr MSAMnMarkRecipients(MSAMParam *paramBlock, Boolean asyncFlag)
  1303.     = {0x3f3c, kMSAMnMarkRecipients, _oceTBDispatch};
  1304.  
  1305. pascal OSErr MSAMOpen(MSAMParam *paramBlock, Boolean asyncFlag)
  1306.     = {0x3f3c, kMSAMOpen, _oceTBDispatch};
  1307. pascal OSErr MSAMOpenNested(MSAMParam *paramBlock, Boolean asyncFlag)
  1308.     = {0x3f3c, kMSAMOpenNested, _oceTBDispatch};
  1309. pascal OSErr MSAMClose(MSAMParam *paramBlock, Boolean asyncFlag)
  1310.     = {0x3f3c, kMSAMClose, _oceTBDispatch};
  1311.  
  1312. pascal OSErr MSAMGetRecipients(MSAMParam *paramBlock, Boolean asyncFlag)
  1313.     = {0x3f3c, kMSAMGetRecipients, _oceTBDispatch};
  1314. pascal OSErr MSAMGetAttributes(MSAMParam *paramBlock, Boolean asyncFlag)
  1315.     = {0x3f3c, kMSAMGetAttributes, _oceTBDispatch};
  1316. pascal OSErr MSAMGetContent(MSAMParam *paramBlock, Boolean asyncFlag)
  1317.     = {0x3f3c, kMSAMGetContent, _oceTBDispatch};
  1318. pascal OSErr MSAMGetEnclosure(MSAMParam *paramBlock, Boolean asyncFlag)
  1319.     = {0x3f3c, kMSAMGetEnclosure, _oceTBDispatch};
  1320. pascal OSErr MSAMEnumerateBlocks(MSAMParam *paramBlock, Boolean asyncFlag)
  1321.     = {0x3f3c, kMSAMEnumerateBlocks, _oceTBDispatch};
  1322. pascal OSErr MSAMGetBlock(MSAMParam *paramBlock, Boolean asyncFlag)
  1323.     = {0x3f3c, kMSAMGetBlock, _oceTBDispatch};
  1324. pascal OSErr MSAMGetMsgHeader(MSAMParam *paramBlock, Boolean asyncFlag)
  1325.     = {0x3f3c, kMSAMGetMsgHeader, _oceTBDispatch};
  1326.  
  1327. /* Put Interface Glue Routines */
  1328. pascal OSErr MSAMCreate(MSAMParam *paramBlock, Boolean asyncFlag)
  1329.     = {0x3f3c, kMSAMCreate, _oceTBDispatch};
  1330. pascal OSErr MSAMBeginNested(MSAMParam *paramBlock, Boolean asyncFlag)
  1331.     = {0x3f3c, kMSAMBeginNested, _oceTBDispatch};
  1332. pascal OSErr MSAMEndNested(MSAMParam *paramBlock)
  1333.     = {0x7000, 0x1f00, 0x3f3c, kMSAMEndNested, _oceTBDispatch};
  1334. pascal OSErr MSAMSubmit(MSAMParam *paramBlock)
  1335.     = {0x7000, 0x1f00, 0x3f3c, kMSAMSubmit, _oceTBDispatch};    /*  SYNCHRONOUS ONLY */
  1336.  
  1337. pascal OSErr MSAMPutAttribute(MSAMParam *paramBlock, Boolean asyncFlag)
  1338.     = {0x3f3c, kMSAMPutAttribute, _oceTBDispatch};
  1339. pascal OSErr MSAMPutRecipient(MSAMParam *paramBlock, Boolean asyncFlag)
  1340.     = {0x3f3c, kMSAMPutRecipient, _oceTBDispatch};
  1341. pascal OSErr MSAMPutContent(MSAMParam *paramBlock, Boolean asyncFlag)
  1342.     = {0x3f3c, kMSAMPutContent, _oceTBDispatch};
  1343. pascal OSErr MSAMPutEnclosure(MSAMParam *paramBlock)
  1344.     = {0x7000, 0x1f00, 0x3f3c, kMSAMPutEnclosure, _oceTBDispatch};    /*  SYNCHRONOUS ONLY */
  1345. pascal OSErr MSAMPutBlock(MSAMParam *paramBlock, Boolean asyncFlag)
  1346.     = {0x3f3c, kMSAMPutBlock, _oceTBDispatch};
  1347. pascal OSErr MSAMPutMsgHeader(MSAMParam *paramBlock, Boolean asyncFlag)
  1348.     = {0x3f3c, kMSAMPutMsgHeader, _oceTBDispatch};
  1349.  
  1350. /* Reports and Error Handling Glue Routines */
  1351. pascal OSErr MSAMCreateReport(MSAMParam *paramBlock, Boolean asyncFlag)
  1352.     = {0x3f3c, kMSAMCreateReport, _oceTBDispatch};
  1353. pascal OSErr MSAMPutRecipientReport(MSAMParam *paramBlock, Boolean asyncFlag)
  1354.     = {0x3f3c, kMSAMPutRecipientReport, _oceTBDispatch};
  1355. pascal OSErr PMSAMLogError(MSAMParam *paramBlock)
  1356.     = {0x7000, 0x1f00, 0x3f3c, kPMSAMLogError, _oceTBDispatch};
  1357.  
  1358. /* MsgSummary Glue Routines */
  1359. pascal OSErr PMSAMCreateMsgSummary(MSAMParam *paramBlock, Boolean asyncFlag)
  1360.     = {0x3f3c, kPMSAMCreateMsgSummary, _oceTBDispatch};
  1361. pascal OSErr PMSAMPutMsgSummary(MSAMParam *paramBlock, Boolean asyncFlag)
  1362.     = {0x3f3c, kPMSAMPutMsgSummary, _oceTBDispatch};
  1363. pascal OSErr PMSAMGetMsgSummary(MSAMParam *paramBlock, Boolean asyncFlag)
  1364.     = {0x3f3c, kPMSAMGetMsgSummary, _oceTBDispatch};
  1365.  
  1366. #ifdef __cplusplus
  1367. };
  1368. #endif
  1369.  
  1370.  
  1371.  
  1372. #endif
  1373.